package rest

import "../dog"

type LastWordsModel struct {
	url_model
	Names []string
}

type LastWordController struct {
	lastword_factory *dog.LastWordFactory
}

func (this *LastWordController) GetSourceName() string {
	return "/API/LastWords"
}

func (this *LastWordController) IsRoot() bool {
	return true
}

func (this *LastWordController) Get(interface{}) interface{} {
	names := this.lastword_factory.GetAllLastWordName()

	return LastWordsModel{
		url_model: url_model{
			Url: this.GetSourceName(),
		},
		Names: names,
	}
}
